package com.base.library.adapter.item;

import android.databinding.ViewDataBinding;
import android.view.View;

import com.base.library.BR;
import com.base.library.adapter.MultiTypeAdapter;


/**
 * base
 */
public abstract class BaseItem implements MultiTypeAdapter.IItem {
    private ViewDataBinding viewDataBinding;

    @Override
    public int getVariableId() {
        return BR.item;
    }

    @Override
    public void onBinding(ViewDataBinding binding) {

        viewDataBinding = binding;
    }

    public <T extends ViewDataBinding> T getViewDataBinding() {
        return (T) viewDataBinding;
    }

    /**
     * item event
     */
    private View.OnClickListener onClickListener;

    public View.OnClickListener getOnClickListener() {
        return onClickListener;
    }

    public void setOnClickListener(View.OnClickListener onClickListener) {
        this.onClickListener = onClickListener;
    }
}